<?php
/**
 * Action Helper for finding days in a month
 */
class Home_Helper_Data2Banco extends Zend_Controller_Action_Helper_Abstract
{
	/**
	 * @var Zend_Loader_PluginLoader
	 */
	public $pluginLoader;

	/**
	 * Constructor: initialize plugin loader
	 *
	 * @return void
	 */
	public function __construct()
	{
		$this->pluginLoader = new Zend_Loader_PluginLoader();
	}


	/**
	 * Strategy pattern: call helper as broker method
	 *
	 * @param  int $month
	 * @param  int $year
	 * @return int
	 */
	public function direct($data)
	{
		return $this->data2banco($data);
	}
	

	
	
	public function data2banco ($d2b) {
	
		if(!empty($d2b)){
			$d2b_ano=substr($d2b,6,4);
			$d2b_mes=substr($d2b,3,2);
			$d2b_dia=substr($d2b,0,2);
			$d2b="$d2b_ano-$d2b_mes-$d2b_dia";
		}
		return $d2b;
	}
	
	
}